<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>module Bundler::URI - bundler: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="module">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    
<div class="nav-section">
  <h3>Table of Contents</h3>

  <ul class="link-list" role="directory">
    <li><a href="#module-Bundler::URI-label-Features">Features</a>
    <li><a href="#module-Bundler::URI-label-Basic+example">Basic example</a>
    <li><a href="#module-Bundler::URI-label-Adding+custom+URIs">Adding custom URIs</a>
    <li><a href="#module-Bundler::URI-label-RFC+References">RFC References</a>
    <li><a href="#module-Bundler::URI-label-Class+tree">Class tree</a>
    <li><a href="#module-Bundler::URI-label-Copyright+Info">Copyright Info</a>
  </ul>
</div>


    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="URI/RFC2396_REGEXP.html">Bundler::URI::RFC2396_REGEXP</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-_decode_uri_component">::_decode_uri_component</a>
    <li ><a href="#method-c-_encode_uri_component">::_encode_uri_component</a>
    <li ><a href="#method-c-decode_uri_component">::decode_uri_component</a>
    <li ><a href="#method-c-decode_www_form">::decode_www_form</a>
    <li ><a href="#method-c-decode_www_form_component">::decode_www_form_component</a>
    <li ><a href="#method-c-encode_uri_component">::encode_uri_component</a>
    <li ><a href="#method-c-encode_www_form">::encode_www_form</a>
    <li ><a href="#method-c-encode_www_form_component">::encode_www_form_component</a>
    <li ><a href="#method-c-extract">::extract</a>
    <li ><a href="#method-c-for">::for</a>
    <li ><a href="#method-c-join">::join</a>
    <li ><a href="#method-c-parse">::parse</a>
    <li ><a href="#method-c-regexp">::regexp</a>
    <li ><a href="#method-c-register_scheme">::register_scheme</a>
    <li ><a href="#method-c-scheme_list">::scheme_list</a>
    <li ><a href="#method-c-split">::split</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="module-Bundler::URI">
    <h1 id="module-Bundler::URI" class="module">
      module Bundler::URI
    </h1>

    <section class="description">
    
<p><a href="URI.html"><code>Bundler::URI</code></a> is a module providing classes to handle Uniform Resource Identifiers (<a href="http://tools.ietf.org/html/rfc2396">RFC2396</a>).</p>

<h2 id="module-Bundler::URI-label-Features">Features<span><a href="#module-Bundler::URI-label-Features">&para;</a> <a href="#top">&uarr;</a></span></h2>
<ul><li>
<p>Uniform way of handling URIs.</p>
</li><li>
<p>Flexibility to introduce custom <a href="URI.html"><code>Bundler::URI</code></a> schemes.</p>
</li><li>
<p>Flexibility to have an alternate <a href="URI/RFC2396_Parser.html"><code>Bundler::URI::Parser</code></a> (or just different patterns and regexp’s).</p>
</li></ul>

<h2 id="module-Bundler::URI-label-Basic+example">Basic example<span><a href="#module-Bundler::URI-label-Basic+example">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/vendor/uri/lib/uri&#39;</span>

<span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>(<span class="ruby-string">&quot;http://foo.com/posts?id=30&amp;limit=5#time=1305298413&quot;</span>)
<span class="ruby-comment">#=&gt; #&lt;Bundler::URI::HTTP http://foo.com/posts?id=30&amp;limit=5#time=1305298413&gt;</span>

<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>    <span class="ruby-comment">#=&gt; &quot;http&quot;</span>
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>      <span class="ruby-comment">#=&gt; &quot;foo.com&quot;</span>
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">path</span>      <span class="ruby-comment">#=&gt; &quot;/posts&quot;</span>
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">query</span>     <span class="ruby-comment">#=&gt; &quot;id=30&amp;limit=5&quot;</span>
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">fragment</span>  <span class="ruby-comment">#=&gt; &quot;time=1305298413&quot;</span>

<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">to_s</span>      <span class="ruby-comment">#=&gt; &quot;http://foo.com/posts?id=30&amp;limit=5#time=1305298413&quot;</span>
</pre>

<h2 id="module-Bundler::URI-label-Adding+custom+URIs">Adding custom URIs<span><a href="#module-Bundler::URI-label-Adding+custom+URIs">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-keyword">module</span> <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>
  <span class="ruby-keyword">class</span> <span class="ruby-constant">RSYNC</span> <span class="ruby-operator">&lt;</span> <span class="ruby-constant">Generic</span>
    <span class="ruby-constant">DEFAULT_PORT</span> = <span class="ruby-value">873</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">register_scheme</span> <span class="ruby-string">&#39;RSYNC&#39;</span>, <span class="ruby-constant">RSYNC</span>
<span class="ruby-keyword">end</span>
<span class="ruby-comment">#=&gt; Bundler::URI::RSYNC</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">scheme_list</span>
<span class="ruby-comment">#=&gt; {&quot;FILE&quot;=&gt;Bundler::URI::File, &quot;FTP&quot;=&gt;Bundler::URI::FTP, &quot;HTTP&quot;=&gt;Bundler::URI::HTTP,</span>
<span class="ruby-comment">#    &quot;HTTPS&quot;=&gt;Bundler::URI::HTTPS, &quot;LDAP&quot;=&gt;Bundler::URI::LDAP, &quot;LDAPS&quot;=&gt;Bundler::URI::LDAPS,</span>
<span class="ruby-comment">#    &quot;MAILTO&quot;=&gt;Bundler::URI::MailTo, &quot;RSYNC&quot;=&gt;Bundler::URI::RSYNC}</span>

<span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>(<span class="ruby-string">&quot;rsync://rsync.foo.com&quot;</span>)
<span class="ruby-comment">#=&gt; #&lt;Bundler::URI::RSYNC rsync://rsync.foo.com&gt;</span>
</pre>

<h2 id="module-Bundler::URI-label-RFC+References">RFC References<span><a href="#module-Bundler::URI-label-RFC+References">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>A good place to view an RFC spec is <a href="http://www.ietf.org/rfc.html">www.ietf.org/rfc.html</a>.</p>

<p>Here is a list of all related RFC’s:</p>
<ul><li>
<p><a href="http://tools.ietf.org/html/rfc822">RFC822</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc1738">RFC1738</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc2255">RFC2255</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc2368">RFC2368</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc2373">RFC2373</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc2396">RFC2396</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc2732">RFC2732</a></p>
</li><li>
<p><a href="http://tools.ietf.org/html/rfc3986">RFC3986</a></p>
</li></ul>

<h2 id="module-Bundler::URI-label-Class+tree">Class tree<span><a href="#module-Bundler::URI-label-Class+tree">&para;</a> <a href="#top">&uarr;</a></span></h2>
<ul><li>
<p><a href="URI/Generic.html"><code>Bundler::URI::Generic</code></a> (in uri/generic.rb)</p>
<ul><li>
<p><a href="URI/File.html"><code>Bundler::URI::File</code></a> - (in uri/file.rb)</p>
</li><li>
<p><a href="URI/FTP.html"><code>Bundler::URI::FTP</code></a> - (in uri/ftp.rb)</p>
</li><li>
<p><a href="URI/HTTP.html"><code>Bundler::URI::HTTP</code></a> - (in uri/http.rb)</p>
<ul><li>
<p><a href="URI/HTTPS.html"><code>Bundler::URI::HTTPS</code></a> - (in uri/https.rb)</p>
</li></ul>
</li><li>
<p><a href="URI/LDAP.html"><code>Bundler::URI::LDAP</code></a> - (in uri/ldap.rb)</p>
<ul><li>
<p><a href="URI/LDAPS.html"><code>Bundler::URI::LDAPS</code></a> - (in uri/ldaps.rb)</p>
</li></ul>
</li><li>
<p><a href="URI/MailTo.html"><code>Bundler::URI::MailTo</code></a> - (in uri/mailto.rb)</p>
</li></ul>
</li><li>
<p><a href="URI/RFC2396_Parser.html"><code>Bundler::URI::Parser</code></a> - (in uri/common.rb)</p>
</li><li>
<p><a href="URI/RFC2396_REGEXP.html"><code>Bundler::URI::REGEXP</code></a> - (in uri/common.rb)</p>
<ul><li>
<p>Bundler::URI::REGEXP::PATTERN - (in uri/common.rb)</p>
</li></ul>
</li><li>
<p>Bundler::URI::Util - (in uri/common.rb)</p>
</li><li>
<p><a href="URI/Error.html"><code>Bundler::URI::Error</code></a> - (in uri/common.rb)</p>
<ul><li>
<p><a href="URI/InvalidURIError.html"><code>Bundler::URI::InvalidURIError</code></a> - (in uri/common.rb)</p>
</li><li>
<p><a href="URI/InvalidComponentError.html"><code>Bundler::URI::InvalidComponentError</code></a> - (in uri/common.rb)</p>
</li><li>
<p><a href="URI/BadURIError.html"><code>Bundler::URI::BadURIError</code></a> - (in uri/common.rb)</p>
</li></ul>
</li></ul>

<h2 id="module-Bundler::URI-label-Copyright+Info">Copyright Info<span><a href="#module-Bundler::URI-label-Copyright+Info">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt>Author
<dd>
<p>Akira Yamada &lt;akira@ruby-lang.org&gt;</p>
</dd><dt>Documentation
<dd>
<p>Akira Yamada &lt;akira@ruby-lang.org&gt; Dmitry V. Sabanin &lt;sdmitry@lrn.ru&gt; Vincent Batts &lt;vbatts@hashbangbash.com&gt;</p>
</dd><dt>License
<dd>
<p>Copyright © 2001 akira yamada &lt;akira@ruby-lang.org&gt; You can redistribute it and/or modify it under the same term as Ruby.</p>
</dd></dl>

    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="DEFAULT_PARSER">DEFAULT_PARSER
          <dd><p><a href="URI/RFC2396_Parser.html#method-c-new"><code>Bundler::URI::Parser.new</code></a></p>
          <dt id="INITIAL_SCHEMES">INITIAL_SCHEMES
          <dd>
          <dt id="Parser">Parser
          <dd>
          <dt id="REGEXP">REGEXP
          <dd>
          <dt id="RFC3986_PARSER">RFC3986_PARSER
          <dd>
          <dt id="TBLENCURICOMP_">TBLENCURICOMP_
          <dd>
        </dl>
        </section>



                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-decode_uri_component" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">decode_uri_component</span><span
                                class="method-args">(str, enc=Encoding::UTF_8)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Decodes given <code>str</code> of URL-encoded data.</p>

<p>This does not decode + to SP.</p>

                              <div class="method-source-code" id="decode_uri_component-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 351</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">decode_uri_component</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>=<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>)
  <span class="ruby-identifier">_decode_uri_component</span>(<span class="ruby-regexp">/%\h\h/</span>, <span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-decode_www_form" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">decode_www_form</span><span
                                class="method-args">(str, enc=Encoding::UTF_8, separator: &#39;&amp;&#39;, use__charset_: false, isindex: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Decodes URL-encoded form data from given <code>str</code>.</p>

<p>This decodes application/x-www-form-urlencoded data and returns an array of key-value arrays.</p>

<p>This refers <a href="http://url.spec.whatwg.org/#concept-urlencoded-parser">url.spec.whatwg.org/#concept-urlencoded-parser</a>, so this supports only &amp;-separator, and doesn’t support ;-separator.</p>

<pre class="ruby"><span class="ruby-identifier">ary</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">decode_www_form</span>(<span class="ruby-string">&quot;a=1&amp;a=2&amp;b=3&quot;</span>)
<span class="ruby-identifier">ary</span>                   <span class="ruby-comment">#=&gt; [[&#39;a&#39;, &#39;1&#39;], [&#39;a&#39;, &#39;2&#39;], [&#39;b&#39;, &#39;3&#39;]]</span>
<span class="ruby-identifier">ary</span>.<span class="ruby-identifier">assoc</span>(<span class="ruby-string">&#39;a&#39;</span>).<span class="ruby-identifier">last</span>   <span class="ruby-comment">#=&gt; &#39;1&#39;</span>
<span class="ruby-identifier">ary</span>.<span class="ruby-identifier">assoc</span>(<span class="ruby-string">&#39;b&#39;</span>).<span class="ruby-identifier">last</span>   <span class="ruby-comment">#=&gt; &#39;3&#39;</span>
<span class="ruby-identifier">ary</span>.<span class="ruby-identifier">rassoc</span>(<span class="ruby-string">&#39;a&#39;</span>).<span class="ruby-identifier">last</span>  <span class="ruby-comment">#=&gt; &#39;2&#39;</span>
<span class="ruby-constant">Hash</span>[<span class="ruby-identifier">ary</span>]             <span class="ruby-comment">#=&gt; {&quot;a&quot;=&gt;&quot;2&quot;, &quot;b&quot;=&gt;&quot;3&quot;}</span>
</pre>

<p>See <a href="URI.html#method-c-decode_www_form_component"><code>Bundler::URI.decode_www_form_component</code></a>, <a href="URI.html#method-c-encode_www_form"><code>Bundler::URI.encode_www_form</code></a>.</p>

                              <div class="method-source-code" id="decode_www_form-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 438</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">decode_www_form</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>=<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>, <span class="ruby-value">separator:</span> <span class="ruby-string">&#39;&amp;&#39;</span>, <span class="ruby-value">use__charset_:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">isindex:</span> <span class="ruby-keyword">false</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;the input of #{self.name}.#{__method__} must be ASCII only string&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">ascii_only?</span>
  <span class="ruby-identifier">ary</span> = []
  <span class="ruby-keyword">return</span> <span class="ruby-identifier">ary</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-identifier">enc</span> = <span class="ruby-constant">Encoding</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">enc</span>)
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">b</span>.<span class="ruby-identifier">each_line</span>(<span class="ruby-identifier">separator</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">string</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">string</span>.<span class="ruby-identifier">chomp!</span>(<span class="ruby-identifier">separator</span>)
    <span class="ruby-identifier">key</span>, <span class="ruby-identifier">sep</span>, <span class="ruby-identifier">val</span> = <span class="ruby-identifier">string</span>.<span class="ruby-identifier">partition</span>(<span class="ruby-string">&#39;=&#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">isindex</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">sep</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-identifier">val</span> = <span class="ruby-identifier">key</span>
        <span class="ruby-identifier">key</span> = <span class="ruby-string">+&#39;&#39;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">isindex</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">use__charset_</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-string">&#39;_charset_&#39;</span> <span class="ruby-keyword">and</span> <span class="ruby-identifier">e</span> = <span class="ruby-identifier">get_encoding</span>(<span class="ruby-identifier">val</span>)
      <span class="ruby-identifier">enc</span> = <span class="ruby-identifier">e</span>
      <span class="ruby-identifier">use__charset_</span> = <span class="ruby-keyword">false</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">key</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/\+|%\h\h/</span>, <span class="ruby-constant">TBLDECWWWCOMP_</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">val</span>
      <span class="ruby-identifier">val</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp">/\+|%\h\h/</span>, <span class="ruby-constant">TBLDECWWWCOMP_</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">val</span> = <span class="ruby-string">+&#39;&#39;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">ary</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ary</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">k</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-identifier">enc</span>)
    <span class="ruby-identifier">k</span>.<span class="ruby-identifier">scrub!</span>
    <span class="ruby-identifier">v</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-identifier">enc</span>)
    <span class="ruby-identifier">v</span>.<span class="ruby-identifier">scrub!</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">ary</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-decode_www_form_component" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">decode_www_form_component</span><span
                                class="method-args">(str, enc=Encoding::UTF_8)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Decodes given <code>str</code> of URL-encoded form data.</p>

<p>This decodes + to SP.</p>

<p>See <a href="URI.html#method-c-encode_www_form_component"><code>Bundler::URI.encode_www_form_component</code></a>, <a href="URI.html#method-c-decode_www_form"><code>Bundler::URI.decode_www_form</code></a>.</p>

                              <div class="method-source-code" id="decode_www_form_component-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 337</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">decode_www_form_component</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>=<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>)
  <span class="ruby-identifier">_decode_uri_component</span>(<span class="ruby-regexp">/\+|%\h\h/</span>, <span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-encode_uri_component" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">encode_uri_component</span><span
                                class="method-args">(str, enc=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Encodes <code>str</code> using URL encoding</p>

<p>This encodes SP to %20 instead of +.</p>

                              <div class="method-source-code" id="encode_uri_component-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 344</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">encode_uri_component</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">_encode_uri_component</span>(<span class="ruby-regexp">/[^*\-.0-9A-Z_a-z]/</span>, <span class="ruby-constant">TBLENCURICOMP_</span>, <span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-encode_www_form" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">encode_www_form</span><span
                                class="method-args">(enum, enc=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Generates URL-encoded form data from given <code>enum</code>.</p>

<p>This generates application/x-www-form-urlencoded data defined in HTML5 from given an Enumerable object.</p>

<p>This internally uses <a href="URI.html#method-c-encode_www_form_component"><code>Bundler::URI.encode_www_form_component(str)</code></a>.</p>

<p>This method doesn’t convert the encoding of given items, so convert them before calling this method if you want to send data as other than original encoding or mixed encoding data. (Strings which are encoded in an HTML5 ASCII incompatible encoding are converted to UTF-8.)</p>

<p>This method doesn’t handle files.  When you send a file, use multipart/form-data.</p>

<p>This refers <a href="https://url.spec.whatwg.org/#concept-urlencoded-serializer">url.spec.whatwg.org/#concept-urlencoded-serializer</a></p>

<pre class="ruby"><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">encode_www_form</span>([[<span class="ruby-string">&quot;q&quot;</span>, <span class="ruby-string">&quot;ruby&quot;</span>], [<span class="ruby-string">&quot;lang&quot;</span>, <span class="ruby-string">&quot;en&quot;</span>]])
<span class="ruby-comment">#=&gt; &quot;q=ruby&amp;lang=en&quot;</span>
<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">encode_www_form</span>(<span class="ruby-string">&quot;q&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;ruby&quot;</span>, <span class="ruby-string">&quot;lang&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;en&quot;</span>)
<span class="ruby-comment">#=&gt; &quot;q=ruby&amp;lang=en&quot;</span>
<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">encode_www_form</span>(<span class="ruby-string">&quot;q&quot;</span> <span class="ruby-operator">=&gt;</span> [<span class="ruby-string">&quot;ruby&quot;</span>, <span class="ruby-string">&quot;perl&quot;</span>], <span class="ruby-string">&quot;lang&quot;</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-string">&quot;en&quot;</span>)
<span class="ruby-comment">#=&gt; &quot;q=ruby&amp;q=perl&amp;lang=en&quot;</span>
<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">encode_www_form</span>([[<span class="ruby-string">&quot;q&quot;</span>, <span class="ruby-string">&quot;ruby&quot;</span>], [<span class="ruby-string">&quot;q&quot;</span>, <span class="ruby-string">&quot;perl&quot;</span>], [<span class="ruby-string">&quot;lang&quot;</span>, <span class="ruby-string">&quot;en&quot;</span>]])
<span class="ruby-comment">#=&gt; &quot;q=ruby&amp;q=perl&amp;lang=en&quot;</span>
</pre>

<p>See <a href="URI.html#method-c-encode_www_form_component"><code>Bundler::URI.encode_www_form_component</code></a>, <a href="URI.html#method-c-decode_www_form"><code>Bundler::URI.decode_www_form</code></a>.</p>

                              <div class="method-source-code" id="encode_www_form-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 402</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">encode_www_form</span>(<span class="ruby-identifier">enum</span>, <span class="ruby-identifier">enc</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">enum</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>,<span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-identifier">encode_www_form_component</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">enc</span>)
    <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:to_ary</span>)
      <span class="ruby-identifier">v</span>.<span class="ruby-identifier">to_ary</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">str</span> = <span class="ruby-identifier">encode_www_form_component</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">enc</span>)
        <span class="ruby-keyword">unless</span> <span class="ruby-identifier">w</span>.<span class="ruby-identifier">nil?</span>
          <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;=&#39;</span>
          <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">encode_www_form_component</span>(<span class="ruby-identifier">w</span>, <span class="ruby-identifier">enc</span>)
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;&amp;&#39;</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">str</span> = <span class="ruby-identifier">encode_www_form_component</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">enc</span>)
      <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&#39;=&#39;</span>
      <span class="ruby-identifier">str</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">encode_www_form_component</span>(<span class="ruby-identifier">v</span>, <span class="ruby-identifier">enc</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;&amp;&#39;</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-encode_www_form_component" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">encode_www_form_component</span><span
                                class="method-args">(str, enc=nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Encodes given <code>str</code> to URL-encoded form data.</p>

<p>This method doesn’t convert *, -, ., 0-9, A-Z, _, a-z, but does convert SP (ASCII space) to + and converts others to %XX.</p>

<p>If <code>enc</code> is given, convert <code>str</code> to the encoding before percent encoding.</p>

<p>This is an implementation of <a href="https://www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data">www.w3.org/TR/2013/CR-html5-20130806/forms.html#url-encoded-form-data</a>.</p>

<p>See <a href="URI.html#method-c-decode_www_form_component"><code>Bundler::URI.decode_www_form_component</code></a>, <a href="URI.html#method-c-encode_www_form"><code>Bundler::URI.encode_www_form</code></a>.</p>

                              <div class="method-source-code" id="encode_www_form_component-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 328</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">encode_www_form_component</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>=<span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">_encode_uri_component</span>(<span class="ruby-regexp">/[^*\-.0-9A-Z_a-z]/</span>, <span class="ruby-constant">TBLENCWWWCOMP_</span>, <span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-extract" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">extract</span><span
                                class="method-args">(str, schemes = nil, &amp;block)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <h2 id="method-c-extract-label-Synopsis">Synopsis<span><a href="#method-c-extract-label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre>Bundler::URI::extract(str[, schemes][,&amp;blk])</pre>

<h2 id="method-c-extract-label-Args">Args<span><a href="#method-c-extract-label-Args">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt><code>str</code>
<dd>
<p>String to extract URIs from.</p>
</dd><dt><code>schemes</code>
<dd>
<p>Limit <a href="URI.html"><code>Bundler::URI</code></a> matching to specific schemes.</p>
</dd></dl>

<h2 id="method-c-extract-label-Description">Description<span><a href="#method-c-extract-label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Extracts URIs from a string. If block given, iterates through all matched URIs. Returns nil if block given or array with matches.</p>

<h2 id="method-c-extract-label-Usage">Usage<span><a href="#method-c-extract-label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&quot;bundler/vendor/uri/lib/uri&quot;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">extract</span>(<span class="ruby-string">&quot;text here http://foo.example.org/bla and here mailto:test@example.com and here also.&quot;</span>)
<span class="ruby-comment"># =&gt; [&quot;http://foo.example.com/bla&quot;, &quot;mailto:test@example.com&quot;]</span>
</pre>

                              <div class="method-source-code" id="extract-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 257</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">extract</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">schemes</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
  <span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;Bundler::URI.extract is obsolete&quot;</span>, <span class="ruby-value">uplevel:</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$VERBOSE</span>
  <span class="ruby-constant">DEFAULT_PARSER</span>.<span class="ruby-identifier">extract</span>(<span class="ruby-identifier">str</span>, <span class="ruby-identifier">schemes</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-for" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">for</span><span
                                class="method-args">(scheme, *arguments, default: Generic)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Construct a <a href="URI.html"><code>Bundler::URI</code></a> instance, using the scheme to detect the appropriate class from <code>Bundler::URI.scheme_list</code>.</p>

                              <div class="method-source-code" id="for-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 95</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-keyword">for</span>(<span class="ruby-identifier ruby-title">scheme</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">arguments</span>, <span class="ruby-value">default:</span> <span class="ruby-constant">Generic</span>)
  <span class="ruby-identifier">const_name</span> = <span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>

  <span class="ruby-identifier">uri_class</span> = <span class="ruby-constant">INITIAL_SCHEMES</span>[<span class="ruby-identifier">const_name</span>]
  <span class="ruby-identifier">uri_class</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\A[A-Z]\w*\z/</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">const_name</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">Schemes</span>.<span class="ruby-identifier">const_defined?</span>(<span class="ruby-identifier">const_name</span>, <span class="ruby-keyword">false</span>)
    <span class="ruby-constant">Schemes</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">const_name</span>, <span class="ruby-keyword">false</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">uri_class</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">default</span>

  <span class="ruby-keyword">return</span> <span class="ruby-identifier">uri_class</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">scheme</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">arguments</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-join" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">join</span><span
                                class="method-args">(*str)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <h2 id="method-c-join-label-Synopsis">Synopsis<span><a href="#method-c-join-label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre>Bundler::URI::join(str[, str, ...])</pre>

<h2 id="method-c-join-label-Args">Args<span><a href="#method-c-join-label-Args">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt><code>str</code>
<dd>
<p>String(s) to work with, will be converted to RFC3986 URIs before merging.</p>
</dd></dl>

<h2 id="method-c-join-label-Description">Description<span><a href="#method-c-join-label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Joins URIs.</p>

<h2 id="method-c-join-label-Usage">Usage<span><a href="#method-c-join-label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/vendor/uri/lib/uri&#39;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&quot;http://example.com/&quot;</span>,<span class="ruby-string">&quot;main.rbx&quot;</span>)
<span class="ruby-comment"># =&gt; #&lt;Bundler::URI::HTTP http://example.com/main.rbx&gt;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;http://example.com&#39;</span>, <span class="ruby-string">&#39;foo&#39;</span>)
<span class="ruby-comment"># =&gt; #&lt;Bundler::URI::HTTP http://example.com/foo&gt;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;http://example.com&#39;</span>, <span class="ruby-string">&#39;/foo&#39;</span>, <span class="ruby-string">&#39;/bar&#39;</span>)
<span class="ruby-comment"># =&gt; #&lt;Bundler::URI::HTTP http://example.com/bar&gt;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;http://example.com&#39;</span>, <span class="ruby-string">&#39;/foo&#39;</span>, <span class="ruby-string">&#39;bar&#39;</span>)
<span class="ruby-comment"># =&gt; #&lt;Bundler::URI::HTTP http://example.com/bar&gt;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39;http://example.com&#39;</span>, <span class="ruby-string">&#39;/foo/&#39;</span>, <span class="ruby-string">&#39;bar&#39;</span>)
<span class="ruby-comment"># =&gt; #&lt;Bundler::URI::HTTP http://example.com/foo/bar&gt;</span>
</pre>

                              <div class="method-source-code" id="join-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 229</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">join</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">str</span>)
  <span class="ruby-constant">RFC3986_PARSER</span>.<span class="ruby-identifier">join</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">str</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-parse" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <h2 id="method-c-parse-label-Synopsis">Synopsis<span><a href="#method-c-parse-label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri_str</span>)
</pre>

<h2 id="method-c-parse-label-Args">Args<span><a href="#method-c-parse-label-Args">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt><code>uri_str</code>
<dd>
<p>String with <a href="URI.html"><code>Bundler::URI</code></a>.</p>
</dd></dl>

<h2 id="method-c-parse-label-Description">Description<span><a href="#method-c-parse-label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Creates one of the <a href="URI.html"><code>Bundler::URI</code></a>‘s subclasses instance from the string.</p>

<h2 id="method-c-parse-label-Raises">Raises<span><a href="#method-c-parse-label-Raises">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt><a href="URI/InvalidURIError.html"><code>Bundler::URI::InvalidURIError</code></a>
<dd>
<p>Raised if <a href="URI.html"><code>Bundler::URI</code></a> given is not a correct one.</p>
</dd></dl>

<h2 id="method-c-parse-label-Usage">Usage<span><a href="#method-c-parse-label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/vendor/uri/lib/uri&#39;</span>

<span class="ruby-identifier">uri</span> = <span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&quot;http://www.ruby-lang.org/&quot;</span>)
<span class="ruby-comment"># =&gt; #&lt;Bundler::URI::HTTP http://www.ruby-lang.org/&gt;</span>
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">scheme</span>
<span class="ruby-comment"># =&gt; &quot;http&quot;</span>
<span class="ruby-identifier">uri</span>.<span class="ruby-identifier">host</span>
<span class="ruby-comment"># =&gt; &quot;www.ruby-lang.org&quot;</span>
</pre>

<p>It’s recommended to first ::escape the provided <code>uri_str</code> if there are any invalid <a href="URI.html"><code>Bundler::URI</code></a> characters.</p>

                              <div class="method-source-code" id="parse-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 192</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">parse</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-constant">RFC3986_PARSER</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">uri</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-regexp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">regexp</span><span
                                class="method-args">(schemes = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <h2 id="method-c-regexp-label-Synopsis">Synopsis<span><a href="#method-c-regexp-label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-identifier">regexp</span>([<span class="ruby-identifier">match_schemes</span>])
</pre>

<h2 id="method-c-regexp-label-Args">Args<span><a href="#method-c-regexp-label-Args">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt><code>match_schemes</code>
<dd>
<p>Array of schemes. If given, resulting regexp matches to URIs whose scheme is one of the match_schemes.</p>
</dd></dl>

<h2 id="method-c-regexp-label-Description">Description<span><a href="#method-c-regexp-label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Returns a Regexp object which matches to <a href="URI.html"><code>Bundler::URI</code></a>-like strings. The Regexp object returned by this method includes arbitrary number of capture group (parentheses).  Never rely on its number.</p>

<h2 id="method-c-regexp-label-Usage">Usage<span><a href="#method-c-regexp-label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/vendor/uri/lib/uri&#39;</span>

<span class="ruby-comment"># extract first Bundler::URI from html_string</span>
<span class="ruby-identifier">html_string</span>.<span class="ruby-identifier">slice</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">regexp</span>)

<span class="ruby-comment"># remove ftp URIs</span>
<span class="ruby-identifier">html_string</span>.<span class="ruby-identifier">sub</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">regexp</span>([<span class="ruby-string">&#39;ftp&#39;</span>]), <span class="ruby-string">&#39;&#39;</span>)

<span class="ruby-comment"># You should not rely on the number of parentheses</span>
<span class="ruby-identifier">html_string</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">regexp</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-operator">*</span><span class="ruby-identifier">matches</span><span class="ruby-operator">|</span>
  <span class="ruby-identifier">p</span> <span class="ruby-node">$&amp;</span>
<span class="ruby-keyword">end</span>
</pre>

                              <div class="method-source-code" id="regexp-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 294</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">regexp</span>(<span class="ruby-identifier">schemes</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">warn</span> <span class="ruby-string">&quot;Bundler::URI.regexp is obsolete&quot;</span>, <span class="ruby-value">uplevel:</span> <span class="ruby-value">1</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">$VERBOSE</span>
  <span class="ruby-constant">DEFAULT_PARSER</span>.<span class="ruby-identifier">make_regexp</span>(<span class="ruby-identifier">schemes</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-register_scheme" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">register_scheme</span><span
                                class="method-args">(scheme, klass)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Register the given <code>klass</code> to be instantiated when parsing URLs with the given <code>scheme</code>. Note that currently only schemes which after .upcase are valid constant names can be registered (no -/+/. allowed).</p>

                              <div class="method-source-code" id="register_scheme-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 76</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">register_scheme</span>(<span class="ruby-identifier">scheme</span>, <span class="ruby-identifier">klass</span>)
  <span class="ruby-constant">Schemes</span>.<span class="ruby-identifier">const_set</span>(<span class="ruby-identifier">scheme</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>, <span class="ruby-identifier">klass</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-scheme_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">scheme_list</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>Returns a Hash of the defined schemes.</p>

                              <div class="method-source-code" id="scheme_list-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 81</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">scheme_list</span>
  <span class="ruby-constant">Schemes</span>.<span class="ruby-identifier">constants</span>.<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    [<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">upcase</span>, <span class="ruby-constant">Schemes</span>.<span class="ruby-identifier">const_get</span>(<span class="ruby-identifier">name</span>)]
  }.<span class="ruby-identifier">to_h</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-split" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">split</span><span
                                class="method-args">(uri)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <h2 id="method-c-split-label-Synopsis">Synopsis<span><a href="#method-c-split-label-Synopsis">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span><span class="ruby-operator">::</span><span class="ruby-identifier">split</span>(<span class="ruby-identifier">uri</span>)
</pre>

<h2 id="method-c-split-label-Args">Args<span><a href="#method-c-split-label-Args">&para;</a> <a href="#top">&uarr;</a></span></h2>
<dl class="rdoc-list note-list"><dt><code>uri</code>
<dd>
<p>String with <a href="URI.html"><code>Bundler::URI</code></a>.</p>
</dd></dl>

<h2 id="method-c-split-label-Description">Description<span><a href="#method-c-split-label-Description">&para;</a> <a href="#top">&uarr;</a></span></h2>

<p>Splits the string on following parts and returns array with result:</p>
<ul><li>
<p>Scheme</p>
</li><li>
<p>Userinfo</p>
</li><li>
<p>Host</p>
</li><li>
<p>Port</p>
</li><li>
<p>Registry</p>
</li><li>
<p>Path</p>
</li><li>
<p>Opaque</p>
</li><li>
<p>Query</p>
</li><li>
<p>Fragment</p>
</li></ul>

<h2 id="method-c-split-label-Usage">Usage<span><a href="#method-c-split-label-Usage">&para;</a> <a href="#top">&uarr;</a></span></h2>

<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;bundler/vendor/uri/lib/uri&#39;</span>

<span class="ruby-constant">Bundler</span><span class="ruby-operator">::</span><span class="ruby-constant">URI</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;http://www.ruby-lang.org/&quot;</span>)
<span class="ruby-comment"># =&gt; [&quot;http&quot;, nil, &quot;www.ruby-lang.org&quot;, nil, nil, &quot;/&quot;, nil, nil, nil]</span>
</pre>

                              <div class="method-source-code" id="split-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 155</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">split</span>(<span class="ruby-identifier">uri</span>)
  <span class="ruby-constant">RFC3986_PARSER</span>.<span class="ruby-identifier">split</span>(<span class="ruby-identifier">uri</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Class Methods</h3>
                </header>

                  <div id="method-c-_decode_uri_component" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_decode_uri_component</span><span
                                class="method-args">(regexp, str, enc)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_decode_uri_component-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 369</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">_decode_uri_component</span>(<span class="ruby-identifier">regexp</span>, <span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>)
  <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;invalid %-encoding (#{str})&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-regexp">/%(?!\h\h)/</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-identifier">str</span>)
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">b</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-identifier">regexp</span>, <span class="ruby-constant">TBLDECWWWCOMP_</span>).<span class="ruby-identifier">force_encoding</span>(<span class="ruby-identifier">enc</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-_encode_uri_component" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">_encode_uri_component</span><span
                                class="method-args">(regexp, table, str, enc)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="_encode_uri_component-source">
            <pre><span class="ruby-comment"># File bundler/vendor/uri/lib/uri/common.rb, line 355</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">_encode_uri_component</span>(<span class="ruby-identifier">regexp</span>, <span class="ruby-identifier">table</span>, <span class="ruby-identifier">str</span>, <span class="ruby-identifier">enc</span>)
  <span class="ruby-identifier">str</span> = <span class="ruby-identifier">str</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">dup</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">str</span>.<span class="ruby-identifier">encoding</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">ASCII_8BIT</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">enc</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">enc</span> <span class="ruby-operator">!=</span> <span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">ASCII_8BIT</span>
      <span class="ruby-identifier">str</span>.<span class="ruby-identifier">encode!</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">UTF_8</span>, <span class="ruby-value">invalid:</span> <span class="ruby-value">:replace</span>, <span class="ruby-value">undef:</span> <span class="ruby-value">:replace</span>)
      <span class="ruby-identifier">str</span>.<span class="ruby-identifier">encode!</span>(<span class="ruby-identifier">enc</span>, <span class="ruby-value">fallback:</span> <span class="ruby-operator">-&gt;</span>(<span class="ruby-identifier">x</span>){<span class="ruby-node">&quot;&amp;##{x.ord};&quot;</span>})
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">str</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">ASCII_8BIT</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-identifier">regexp</span>, <span class="ruby-identifier">table</span>)
  <span class="ruby-identifier">str</span>.<span class="ruby-identifier">force_encoding</span>(<span class="ruby-constant">Encoding</span><span class="ruby-operator">::</span><span class="ruby-constant">US_ASCII</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is a service of <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>, purveyors of fine <a href='https://jamesbritt.bandcamp.com/'>dance noise</a></p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

